perm filename COREWA.XGP[LET,JMC] blob sn#384964 filedate 1978-09-28 generic text, type T, neo UTF8
/LMAR=0/XLINE=3/FONT#0=BAXL30/FONT#1=BAXM30/FONT#2=BASB30/FONT#3=SUB/FONT#4=SUP/FONT#5=BASL35/FONT#6=NGR25/FONT#7=MATH30/FONT#8=FIX25/FONT#9=GRKB30
␈↓ α∧␈↓␈↓ u1


␈↓ α∧␈↓α␈↓ ε.CORE WAR

␈↓ α∧␈↓␈↓ αT␈↓↓Core␈α∂War␈↓␈α∂is␈α∂a␈α⊂two-person␈α∂competitive␈α∂game␈α∂played␈α∂in␈α⊂the␈α∂memory␈α∂of␈α∂a␈α⊂computer.␈α∂ The
␈↓ α∧␈↓winner␈α∞is␈α∞the␈α∂player␈α∞who␈α∞first␈α∂sets␈α∞all␈α∞locations␈α∞in␈α∂a␈α∞disputed␈α∞area␈α∂to␈α∞his␈α∞player␈α∂number.␈α∞ The
␈↓ α∧␈↓players␈αcreate␈αprograms␈αthat␈αtry␈αto␈αdestroy␈αor␈αsubvert␈αthe␈αopponents␈αprograms␈αand␈αcreate␈αfurther
␈↓ α∧␈↓allied␈α
programs.␈α If␈α
␈↓↓core␈α
war␈↓␈αbecomes␈α
popular,␈α
artificial␈αintelligence␈α
may␈α
benefit,␈αbecause␈α
successful
␈↓ α∧␈↓play will require very intelligent programs.


␈↓ α∧␈↓αGeneral description

␈↓ α∧␈↓␈↓ αTEach␈α⊃player␈α⊃has␈α⊃his␈α⊃own␈α⊃display␈α⊃terminal␈α⊃on␈α⊃which␈α⊃are␈α⊃displayed␈α⊃the␈α⊃contents␈α⊃of␈α⊃100
␈↓ α∧␈↓registers␈α⊃of␈α⊃memory␈α∩under␈α⊃his␈α⊃immediate␈α∩control.␈α⊃ He␈α⊃can␈α⊃also␈α∩change␈α⊃the␈α⊃contents␈α∩of␈α⊃these
␈↓ α∧␈↓registers␈αdirectly␈α
-␈αas␈αfast␈α
as␈αhe␈α
can␈αtype.␈α He␈α
can␈αchange␈α
the␈αcontents␈αof␈α
other␈αregisters,␈α
but␈αthe
␈↓ α∧␈↓change␈αis␈α
not␈αimmediately␈α
effective,␈αand␈α
he␈αcan␈α
do␈αnothing␈α
else␈αwhile␈α
he␈αwaits.␈α
 His␈αprograms␈α
can
␈↓ α∧␈↓also display on his screen.

␈↓ α∧␈↓␈↓ αTThere␈α
are␈α
100␈α
parallel␈α
processes␈α
each␈α
of␈αwhich␈α
has␈α
a␈α
program␈α
counter␈α
and␈α
some␈αPDP-10
␈↓ α∧␈↓type␈αaccumulators.␈α An␈αinterpreter␈αcycles␈αamong␈αthese␈αprogram␈αcounters,␈αexecuting␈αinstructions␈αin
␈↓ α∧␈↓turn.␈α A␈αslow␈αinstruction␈αmay␈αbe␈αskipped␈αa␈αnumber␈αof␈αturns␈αbefore␈αit␈αis␈αfinally␈αexecuted.␈α
 Initially
␈↓ α∧␈↓50 of these processes are executing "jump self" instructions in each player's area.

␈↓ α∧␈↓␈↓ αTA␈α
player␈α
begins␈α
by␈α
typing␈α
in␈α
some␈α
programs.␈α Once␈α
a␈α
program␈α
is␈α
typed␈α
in␈α
he␈α
can␈α
start␈αit
␈↓ α∧␈↓going␈α∂at␈α∞some␈α∂register␈α∞by␈α∂modifying␈α∞one␈α∂of␈α∞the␈α∂"jump␈α∞self"␈α∂instructions.␈α∞ Then␈α∂he␈α∞can␈α∂type␈α∞in
␈↓ α∧␈↓another program and start it.

␈↓ α∧␈↓␈↓ αTHis␈α∂programs␈α⊂can␈α∂write␈α⊂new␈α∂programs␈α∂and␈α⊂activate␈α∂them␈α⊂by␈α∂modifying␈α⊂hitherto␈α∂unused
␈↓ α∧␈↓"jump␈α
self"␈αinstructions.␈α
 An␈αobvious␈α
way␈αa␈α
program␈α
can␈αget␈α
another␈αgoing␈α
is␈αto␈α
copy␈α
itself␈αinto
␈↓ α∧␈↓new memory and activate the copy.

␈↓ α∧␈↓␈↓ αTThe␈α⊃primary␈α⊃means␈α∩of␈α⊃fighting␈α⊃is␈α∩to␈α⊃capture␈α⊃the␈α∩program␈α⊃counters␈α⊃under␈α∩the␈α⊃enemy's
␈↓ α∧␈↓control.␈α⊃ Thus␈α⊃if␈α⊂one␈α⊃player␈α⊃stores␈α⊂a␈α⊃jump␈α⊃instruction␈α⊂in␈α⊃the␈α⊃other's␈α⊂program␈α⊃that␈α⊃goes␈α⊃to␈α⊂a
␈↓ α∧␈↓location␈α∩with␈α⊃a␈α∩"jump␈α⊃self"␈α∩in␈α∩the␈α⊃attacker's␈α∩domain,␈α⊃the␈α∩attacker␈α⊃can␈α∩subsequently␈α∩use␈α⊃that
␈↓ α∧␈↓program counter.  A player with no programs doing his will is helpless.

␈↓ α∧␈↓␈↓ αTAn␈αinstruction␈αthat␈αreferences␈α
memory␈αtakes␈αan␈αamount␈α
of␈αtime␈αproportional␈αto␈αthe␈α
distance
␈↓ α∧␈↓between␈α∂the␈α⊂instruction␈α∂and␈α∂the␈α⊂register␈α∂referenced␈α∂unless␈α⊂there␈α∂is␈α∂a␈α⊂␈↓↓barrier␈↓␈α∂word␈α⊂between␈α∂the
␈↓ α∧␈↓instruction␈αand␈αthe␈αdestination.␈α In␈αthat␈αcase,␈αthe␈αinstruction␈αis␈αnot␈αexecuted␈αbut␈αthe␈αlocation␈αand
␈↓ α∧␈↓type␈αof␈α
the␈αbarrier␈α
encountered␈αare␈α
stored␈αin␈α
one␈αoc␈α
the␈αprocess's␈α
accumulators.␈α Ordinary␈α
barriers
␈↓ α∧␈↓can␈α∞be␈α∞created␈α∂by␈α∞storing␈α∞into␈α∂registers,␈α∞and␈α∞immovable␈α∞barriers␈α∂existing␈α∞when␈α∞the␈α∂game␈α∞starts
␈↓ α∧␈↓have␈α⊂the␈α∂effect␈α⊂of␈α∂defining␈α⊂terrain.␈α∂ A␈α⊂barrier␈α⊂word␈α∂has␈α⊂specified␈α∂contents␈α⊂and␈α∂is␈α⊂not␈α⊂a␈α∂legal
␈↓ α∧␈↓instruction.

␈↓ α∧␈↓␈↓ αTThe␈α
addressing␈α
of␈α∞memory␈α
treats␈α
it␈α∞as␈α
a␈α
one␈α
dimensional␈α∞array,␈α
but␈α
the␈α∞distance␈α
function
␈↓ α∧␈↓treats␈αit␈αas␈αa␈αrectangle␈α100␈αby␈α500␈αregisters␈αin␈αsize.␈α With␈αrespect␈αto␈αthis␈αgeometry,␈αthe␈αdistance␈αis
␈↓ α∧␈↓Euclidean.

␈↓ α∧␈↓␈↓ αTThe␈αbasic␈αlanguage␈αis␈αa␈αsingle␈αaddress␈αcode␈αwith␈αeight␈αgeneral␈αregisters␈αone␈αof␈αwhich␈αis␈αthe
␈↓ α∧␈↓program␈α⊂counter.␈α⊂ Each␈α⊂process␈α⊂has␈α⊂its␈α⊂own␈α⊂general␈α⊂registers␈α⊂and␈α⊂program␈α⊂counter␈α⊂which␈α∂are
␈↓ α∧␈↓␈↓ u2


␈↓ α∧␈↓identified␈α
with␈αthe␈α
first␈αeight␈α
registers␈α
of␈αthe␈α
process␈αand␈α
hence␈α
can␈αbe␈α
stored␈αinto␈α
by␈α
an␈αenemy
␈↓ α∧␈↓trying to subvert the program or by a friendly program supplying data.

␈↓ α∧␈↓␈↓ αTWhile␈α↔the␈α⊗basic␈α↔language␈α↔is␈α⊗machine␈α↔language,␈α↔processes␈α⊗may␈α↔call␈α↔read-only␈α⊗LISP
␈↓ α∧␈↓subroutines.␈α⊃ These␈α⊃subroutines␈α⊂affect␈α⊃only␈α⊃a␈α⊂specified␈α⊃area␈α⊃of␈α⊂main␈α⊃memory␈α⊃and␈α⊃can␈α⊂return
␈↓ α∧␈↓results␈αonly␈αto␈αthe␈αgeneral␈αregisters␈αof␈αthe␈αcalling␈αprogram␈αor␈αto␈αthe␈αhuman's␈αdisplay.␈α Thus␈αLISP
␈↓ α∧␈↓can␈αbe␈αused␈αfor␈α
thinking␈αbut␈αnot␈αfor␈α
action.␈α Each␈αplayer␈αhas␈αa␈α
quota␈αof␈αLISP␈αmemory␈α
and␈αcan
␈↓ α∧␈↓write␈α
subroutines␈α
in␈α
it␈α
before␈α
the␈α
game␈α
starts.␈α
 The␈α
purpose␈α
of␈α
the␈α
LISP␈α
is␈α
to␈α
allow␈αmore␈α
elaborate
␈↓ α∧␈↓strategies␈α∞than␈α∞can␈α∞be␈α
conveniently␈α∞implemented␈α∞in␈α∞machine␈α
language.␈α∞ The␈α∞entry␈α∞points␈α∞to␈α
the
␈↓ α∧␈↓LISP␈αsubroutines␈αare␈α
in␈αthe␈αplayer's␈α
home␈αarea␈αso␈α
his␈αadvance␈αguards␈α
think␈αmore␈αslowly␈αthan␈α
the
␈↓ α∧␈↓generals at home.

␈↓ α∧␈↓␈↓ αT␈↓↓Corewar␈↓␈αis␈αlikely␈αto␈αwant␈αa␈αlot␈αof␈αcomputer␈αmemory.␈α In␈αorder␈αto␈αsave␈αmemory,␈αit␈αis␈αdivided
␈↓ α∧␈↓into␈α
blocks.␈α
 If␈αthere␈α
has␈α
been␈α
no␈αactivity␈α
in␈α
a␈α
block␈αin␈α
a␈α
long␈α
time,␈αit␈α
reverts␈α
to␈α
a␈αstandard,␈α
briefly
␈↓ α∧␈↓described state, and the extra memory is garbage collected.


␈↓ α∧␈↓αThe intellectual spirit of the game

␈↓ α∧␈↓␈↓ αT␈↓↓Corewar␈↓␈αis␈αintended␈αto␈αbe␈αa␈αgame␈αadmitting␈αvery␈αsubtle␈αstrategies␈αwith␈αas␈αmuch␈αintelligence
␈↓ α∧␈↓as␈α
the␈α
players␈αcan␈α
devise␈α
and␈α
hopefully␈αgoing␈α
beyond␈α
anything␈α
the␈αdesigners␈α
of␈α
the␈α
game␈αcan␈α
now
␈↓ α∧␈↓imagine.␈α
 Should␈α
it␈α
turn␈α
out␈α∞that␈α
a␈α
brute␈α
force␈α
strategy␈α∞is␈α
effective␈α
against␈α
all␈α
comers,␈α∞the␈α
game
␈↓ α∧␈↓should be changed.

␈↓ α∧␈↓␈↓ αTEffective␈αstrategies␈αfor␈αthe␈αplayers␈αare␈αconstrained␈αby␈αgeometry.␈α Since␈αa␈αlong␈αdistance␈αstore
␈↓ α∧␈↓take␈αa␈αlong␈α
time,␈αand␈αmay␈α
encounter␈αbarriers,␈αit␈α
is␈αnot␈αfeasible␈α
to␈αdestroy␈αthe␈α
enemy␈αby␈αlong␈α
range
␈↓ α∧␈↓bombardment␈α
of␈α
(storing␈α
into)␈α
his␈α
home␈α
territory.␈α
 Instead␈α
it␈α
is␈α
necessary␈α
to␈α
have␈α
programs␈αthat
␈↓ α∧␈↓will␈αadvance␈αand␈αbombard␈αfrom␈αclose␈αrange.␈α Since␈αan␈αenemy␈αprogram␈αthat␈αsneaks␈αclose␈αcan␈αdo␈αa
␈↓ α∧␈↓lot␈αof␈αdamage,␈αit␈α
is␈αnecessary␈αto␈αhave␈α
programs␈αthat␈αscan␈αas␈α
much␈αterritory␈αas␈αpossible␈α
and␈αmass
␈↓ α∧␈↓firepower against enemy programs that sneak close.

␈↓ α∧␈↓␈↓ αTSince␈α∞a␈α∞big␈α∞program␈α∞can␈α
be␈α∞damaged␈α∞by␈α∞changing␈α∞a␈α
single␈α∞instruction,␈α∞it␈α∞is␈α∞important␈α
to
␈↓ α∧␈↓check␈α∂the␈α∂integrity␈α∂of␈α∂a␈α∞section␈α∂of␈α∂program␈α∂before␈α∂entering␈α∞it.␈α∂ Of␈α∂course,␈α∂the␈α∂enemy␈α∂hopes␈α∞to
␈↓ α∧␈↓subvert␈α
a␈αlocation␈α
just␈α
before␈αyour␈α
program␈αexecutes␈α
it,␈α
but␈αhis␈α
program␈αcan't␈α
readily␈α
tell␈αwhich
␈↓ α∧␈↓locations␈αwill␈αbe␈αactive␈αsoon.␈α A␈αprogram␈αfinding␈αitself␈αseriously␈αdamaged␈αshould␈αjump␈αback␈αto␈αa
␈↓ α∧␈↓home program, lest it be subverted.

␈↓ α∧␈↓␈↓ αTIf␈α⊃an␈α⊂enemy␈α⊃program␈α⊂can␈α⊃be␈α⊂inspected␈α⊃and␈α⊂understood,␈α⊃it␈α⊂can␈α⊃perhaps␈α⊂be␈α⊃modified␈α⊂to
␈↓ α∧␈↓sabotage␈α∩the␈α∩enemy␈α∩undetected.␈α⊃ A␈α∩side␈α∩may␈α∩require␈α⊃commissar␈α∩programs␈α∩to␈α∩check␈α∩its␈α⊃other
␈↓ α∧␈↓programs for orthodoxy.  Subverting a commissar may win big.

␈↓ α∧␈↓␈↓ αTThe␈α∞rules␈α∞concerning␈α∞the␈α∞time␈α∞required␈α∞create␈α
barriers␈α∞should␈α∞be␈α∞designed␈α∞so␈α∞as␈α∞to␈α
make
␈↓ α∧␈↓them useful but not dominant.

␈↓ α∧␈↓␈↓ αTThe␈αterrain␈αimposed␈αby␈αthe␈αinitial␈αbarriers␈αis␈αunknown␈αto␈αthe␈αplayers.␈α It␈αmay␈αbe␈αexplored
␈↓ α∧␈↓by programs.

␈↓ α∧␈↓␈↓ αTInitially,␈αwe␈αsuppose␈α
that␈αplayers␈αwill␈α
have␈αto␈αdo␈α
all␈αcomplex␈αthinking␈α
themselves.␈α Success
␈↓ α∧␈↓will␈α
come␈α
from␈α
delegating␈α
more␈α
and␈α
more␈α
complex␈α
tasks␈α
to␈α
the␈α
soldier␈α
programs.␈α
 If␈α
a␈αplayer␈α
could
␈↓ α∧␈↓␈↓ u3


␈↓ α∧␈↓make␈α
a␈α
general␈αprogram␈α
more␈α
intelligent␈α
at␈αcore␈α
war␈α
than␈α
himself,␈αthen␈α
he␈α
would␈α
have␈αnothing
␈↓ α∧␈↓further␈α∞to␈α∞do,␈α∞since␈α∞watching␈α∞the␈α∞game␈α∞wouldn't␈α∞give␈α∞him␈α∞any␈α∞good␈α∞ideas␈α∞of␈α∞how␈α∞to␈α
intervene.
␈↓ α∧␈↓This␈α
is␈αunlikely␈α
to␈αoccur␈α
in␈α
the␈αnear␈α
future.␈α Indeed␈α
it␈αseems␈α
more␈α
likely␈αthat␈α
for␈αa␈α
long␈α
time␈αto
␈↓ α∧␈↓come,␈αeven␈αinexperienced␈αplayers␈αwill␈αfind␈αthe␈αinitial␈αroutines␈αcreated␈αby␈αcorewar␈αexperts␈αmaking
␈↓ α∧␈↓mistakes that intervention can correct.


␈↓ α∧␈↓αSpectators

␈↓ α∧␈↓␈↓ αT␈↓↓Corewar␈↓␈α
can␈α
be␈α∞a␈α
good␈α
spectator␈α∞sport.␈α
 Registers␈α
are␈α
colored␈α∞according␈α
to␈α
the␈α∞player␈α
who
␈↓ α∧␈↓last␈αaffected␈αthem␈αand␈αalso␈αaccording␈αto␈αwho␈αlast␈αlooked␈αat␈αthem␈αand␈αthese␈αcolors␈αfade␈αwith␈αtime.
␈↓ α∧␈↓When␈α
one␈α
player␈α
stores␈α
into␈α
a␈α
program␈α
belonging␈α
to␈α
another␈α
and␈α
that␈α
instruction␈α
is␈αexecuted,␈α
then
␈↓ α∧␈↓the␈αsubsequently␈α
executed␈αinstructions␈α
suddenly␈αchange␈αcolor.␈α
 The␈αplayers␈α
will␈αhave␈αsimilar␈α
maps
␈↓ α∧␈↓describing the regions they know about.

␈↓ α∧␈↓␈↓ αTAt␈αthe␈αStanford␈αAI␈αLab,␈αthe␈αintent␈α
would␈αbe␈αto␈αhave␈α␈↓↓Corewar␈↓␈αrun␈αin␈αthe␈α
PDP-11/45␈αwith
␈↓ α∧␈↓the␈αzonker␈αmemory␈αso␈αas␈αto␈αnot␈αinterfere␈αwith␈αthe␈αKL-10.␈α It␈αwould␈αbe␈αa␈αstand-alone␈αprogram␈αas
␈↓ α∧␈↓far as the PDP-11 is concerned and would be the lowest priority use of the PDP-11.

␈↓ α∧␈↓John McCarthy
␈↓ α∧␈↓Artificial Intelligence Laboratory
␈↓ α∧␈↓Computer Science Department
␈↓ α∧␈↓Stanford University
␈↓ α∧␈↓Stanford, California 94305

␈↓ α∧␈↓ARPANET: MCCARTHY@SU-AI

␈↓ α∧␈↓␈↓ αT␈↓εThis draft of COREWA[S77,JMC] PUBbed at 0:57 on September 28, 1978.␈↓